package it.unibo.convoycruisecontrol.simulation;
import it.unibo.convoycruisecontrol.boatsubsystem.AbstractCommandBoat;

/**
 * @author ale
 * @version 1.0
 * @created 24-ott-2012 00:47:21
 */
public class Simulator {

	private AbstractCommandBoat commandBoat;
	private int speedRatio = 100;

	/**
	 * 
	 * @param commandBoat
	 */
	public Simulator(AbstractCommandBoat commandBoat)
	{
		this.commandBoat = commandBoat;
	}

	public void decSpeed()
	{
		commandBoat.setTargetSpeed(commandBoat.getTargetSpeed()-speedRatio);
	}

	public AbstractCommandBoat getCommandBoat(){
		return null;
	}

	public void incSpeed()
	{
		commandBoat.setTargetSpeed(commandBoat.getTargetSpeed()+speedRatio);
	}

	public void stopBoat()
	{
		commandBoat.stopBoat();
	}

	public void changeBoatCondition()
	{
		// So che sono in simulazione
		AbstractSimulatorStatusBoat statusBoat = (AbstractSimulatorStatusBoat)commandBoat.getStatusBoat();
		statusBoat.setBroken(!statusBoat.isBroken());
	}

}